package membased;

import java.io.Serializable;

import com.gash.scrape.ParseObject;

public class dbObject implements Serializable{
	/*
	public String title = "mongodb - wikipedia, the free encyclopedia";
	public String url = "http://en.wikipedia.org/wiki/MongoDB";
	public String[] keywords = {"mongodb", "data", "javascript"};
	public String[] links = {"http://en.wikipedia.org/wiki/windows",
			"http://code.google.com/p/rock-php/", "http://en.wikipedia.org/wiki/help:contents"};
	public String[] citations = {"http://en.wikipedia.org/wiki/MongoDB#cite_ref-cpp_16-0",
			"http://en.wikipedia.org/wiki/MongoDB#cite_note-rockmongo-51", 
			"http://en.wikipedia.org/wiki/MongoDB#cite_note-groovy-33"};
*/
	public String title;
	public String url;
	public String[] keywords;
	public String[] links;
	public String[] citations;
	
	public dbObject(ParseObject obj) {
		title = obj.title;
		url = obj.url;
		for(int i = 0; i < obj.keywords.size(); i++)
			keywords[i] = obj.keywords.get(i);
		for(int i = 0; i < obj.links.size(); i++)
			links[i] = obj.links.get(i);
		for(int i = 0; i < obj.citations.size(); i++)
			citations[i] = obj.citations.get(i);
	}

	public void objectDump() {
		System.out.println("Title: " +title);
		System.out.println();
		System.out.println("URL: " +url);
		System.out.println();
		System.out.print("Keywords: ");
		for(int i = 0; i < keywords.length; i++) {
			System.out.print(keywords[i] +" ");
		}
		System.out.println();
		System.out.println("\nLinks: ");
		for(int i = 0; i < links.length; i++) {
			System.out.println(links[i] + " ");
		}
		System.out.println();
		System.out.println("Citations: ");
		for(int i = 0; i < citations.length; i++) {
			System.out.println(citations[i]);
		}
	}
}
